//
//  ZCHotinformationCell.m
//  zctx
//
//  Created by apple on 15/11/25.
//  Copyright © 2015年 sanliang. All rights reserved.
//

#import "ZCHotinformationCell.h"

@implementation ZCHotinformationCell

- (void)awakeFromNib {
    // Initialization code
    self.titleLable.textColor = [UIColor colorWithHexString:@"#000000"];
    self.contentLable.textColor = [UIColor colorWithHexString:@"#a5a5a5"];
    self.numLable.textColor = [UIColor colorWithHexString:@"#b2b2b2"];
    self.zctxLable.textColor = [UIColor colorWithHexString:@"#b2b2b2"];
}
-(void)setNewsDict:(NSDictionary *)newsDict{
    _newsDict = newsDict;
    
    self.titleLable.text = [NSString stringWithFormat:@"%@",[newsDict objectForKey:@"title"]];
    self.zctxLable.text = [NSString stringWithFormat:@"%@",[newsDict objectForKey:@"author"]];
    self.contentLable.text = [NSString stringWithFormat:@"%@",[newsDict objectForKey:@"description"]];
    NSString *imageStr =[NSString stringWithFormat:@"%@%@",[NetworkManager strURLBasic],[newsDict objectForKey:@"thumb"]];
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:imageStr] placeholderImage:[UIImage imageNamed:@"placehold_hotnews"]];
    
    NSString *numStr =[NSString stringWithFormat:@"%@",[newsDict objectForKey:@"comment_count"]];
    
    if ([numStr integerValue]>99) {
        self.numLable.text =[NSString stringWithFormat:@"99+"];
    }else{
        self.numLable.text =[NSString stringWithFormat:@"%@",[newsDict objectForKey:@"comment_count"]];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
